package com.lhoverc.controller.admin;

import com.lhoverc.pojo.Result;
import com.lhoverc.pojo.VO.ComplaintVO;
import com.lhoverc.pojo.dto.ComplaintReplyDto;
import com.lhoverc.service.complaint.ComplaintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: LiCheng
 * @CreateTime: 2025-05-03
 * @Description:
 * @Version: 1.0
 */
@RestController
@RequestMapping("/admin/complaint")
public class AdminComplaintController {

    @Autowired
    private ComplaintService complaintService;

    /**
     * 获取投诉数据
     * @return
     */
    @GetMapping("/getComplaintAdvice")
    public Result getComplaintAdvice() {
        List<ComplaintVO> complaintVOList = complaintService.getComplaintAdvice();
        return Result.success(complaintVOList);
    }

    /**
     * 处理投诉
     * @param complaintReplyDto
     * @return
     */
    @PostMapping("/reply")
    public Result replyComplaint(@RequestBody ComplaintReplyDto complaintReplyDto) {
        complaintService.isDeal(complaintReplyDto);
        return Result.success();
    }
}
